package aliyun.cx.common.controller;

import aliyun.cx.common.util.ResponseUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * 公共模块控制器
 */
@RestController
@RequestMapping("/api/common")
public class CommonController {
    
    @GetMapping("/health")
    public Map<String, Object> health() {
        Map<String, Object> data = new HashMap<>();
        data.put("status", "UP");
        data.put("timestamp", System.currentTimeMillis());
        return ResponseUtil.success("Common module is healthy", data);
    }
    
    @GetMapping("/info")
    public Map<String, Object> info() {
        Map<String, Object> data = new HashMap<String, Object>() {{
            put("module", "demo_common");
            put("version", "1.0-SNAPSHOT");
            put("description", "公共模块 - 提供共享的工具类、配置和通用功能");
        }};
        return ResponseUtil.success(data);
    }
}
